package action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.ActionForm;
import bean.User;

public class RegisterAction implements Action {

	public Map<String, String> execute(HttpServletRequest request,
			HttpServletResponse response, ActionForm form) {
		User user = (User)form;
		
		Map<String, String> map = new HashMap<String, String>();
		if("1".equals(user.getUsername()) && "1".equals(user.getPassword())){
			map.put("url", "/WEB-INF/view/success.jsp");
			map.put("message", "yes");
		}else{
			map.put("url", "/WEB-INF/view/fail.jsp");
			map.put("message", "no");
		}
		
		return map;
	}

}
